package Home;

import java.util.*;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Locale;

import mylooks.greenteam.Registration.User;
import Home.HomeAdapter;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import mylooks.greenteam.R;
import android.content.*;
import android.content.res.Resources;

public class HomeAdapter extends FragmentPagerAdapter 
{
	List<Fragment> home_fragment_list;
	ProfileFragment fr_profile;
	WardrobeFragment fr_wardrobe;
	SocialFragment fr_social;
	private Context context;

	public HomeAdapter(FragmentManager fm, Context c) 
	{
		super(fm);
		context=c;
		fr_profile = new ProfileFragment();
		fr_wardrobe = new WardrobeFragment();
		fr_social = new SocialFragment();
		
		home_fragment_list = new ArrayList<Fragment>();
		
		home_fragment_list.add(fr_profile);
		home_fragment_list.add(fr_wardrobe);
		home_fragment_list.add(fr_social);
	}

	
	@Override
	public Fragment getItem(int index) 
	{
		return home_fragment_list.get(index);
	}

	@Override
	public int getCount() 
	{
		return home_fragment_list.size();
	}
	
	public CharSequence getPageTitle(int position) 
	{
		Locale l = Locale.getDefault();
		
		switch (position) 
		{
			case 0:
				return context.getString(R.string.title_profile);
			case 1:
				return context.getString(R.string.title_wardrobe);
			case 2:
				return context.getString(R.string.title_social);
		}
		return null;
	}
}
